<?php 
/**
 * Modelo de la table smssetupci
 * @author Natanael Acosta
 * 
 */
class Smssetupci extends Model{
      
	  private $_nameTable = "SMS_SetupCI";
	  
	  public function __construct()
	  {
	     parent::Model();
	     $this->load->database();
	  }
	  
      public function loadRegistro($start = false, $offset = false, $sortname = false, $sortorder = false)
      {
            
           if($offset != false)
		       $this->db->limit($offset, $start);

		   if($sortname != false && $sortorder != false) 
			    $this->db->order_by($sortname, $sortorder);
				  
		    $result = $this->db->get_where($this->_nameTable);
	
			return $this->GetArrayFromQueryResult($result);
			
       }
       
         
       public function GetArrayFromQueryResult($result) 
	   {
			if ($result->num_rows() == 0)
				return false;
	
			$estatus_arr = array();
	
			foreach ($result->result() as $record) {
				$estatus_arr[] = new SMS_SetupCI($record);
		    }
	
			return $estatus_arr;
       }
       
       public function edit($data)
       {
           if ($this->db->update($this->_nameTable,$data)) {
           	  return true;
           }
           
            return false;
       }
       

}


class SMS_SetupCI{

       private $_scriptFirma = 0;
       private $_etapaDesde = 0;
       private $_etapaHasta = 0;
       private $_scriptEmail = 0;
       
       public function __construct($ojt)
       {
          $this->setScriptFirma($ojt->scriptFirma);
          $this->setEtapaDesde($ojt->etapaDesde);
          $this->setEtapaHasta($ojt->etapaHasta);
          $this->setScriptEmail($ojt->scriptEmail);
       }
       
       public function getScriptFirma()
       {
            return $this->_scriptFirma;
       }
       
       public function setScriptFirma($value)
       {
            $this->_scriptFirma = $value;
       }
       
       public function getScriptEmail()
       {
            return $this->_scriptEmail;
       }
       
       public function setScriptEmail($value)
       {
            $this->_scriptEmail = $value;
       }
       
       public function getEtapaDesde()
       {
            return $this->_etapaDesde;
       }
       
       public function setEtapaDesde($value)
       {
            $this->_etapaDesde = $value;
       }
       
       public function getEtapaHasta()
       {
            return $this->_etapaHasta;
       }
       
       public function setEtapaHasta($value)
       {
            $this->_etapaHasta = $value;
       }
       
}

